<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>flex 基本使用</title>
    <style type="text/css">
      .container {
        display: flex;
        margin: 0 auto;
        border: black solid;
        width: 500px;
        /* 主轴方向（行） */
        /* flex-direction: row; */
        /* 单行显示还是多行显示（多行），子容器需设置宽或高 */
        /* flex-wrap: wrap; */
        /* 以上两种简单写 */
        flex-flow: row wrap;
      }

      .wrapper {
        margin: 10px;
        height: 100px;
        width: 100px;
        background-color: black;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="wrapper"></div>
      <div class="wrapper"></div>
      <div class="wrapper"></div>
      <div class="wrapper"></div>
      <div class="wrapper"></div>
      <div class="wrapper"></div>
      <div class="wrapper"></div>
    </div>
  </body>
</html>
